Hệ thống quản lý phương tiện trong PHP
1 <?php
2 $conn=mysqli_connect('localhost','root','','vehiclemanagement');
3 $sql="SELECT * FROM bill ";
4 $result=mysqli_query($conn,$sql);
5 if(!isset($_SESSION))
6 {
7 session_start();
8 }
9
10 ?>
11
12
13 <!DOCTYPE html>
14 <html lang="en">
15 <head>
16 <meta charset="utf-8">
17 <title>Welcome to Vehicle Management</title>
18 <meta name="description" content="Bootstrap.">
19 <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
20 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
21 <link rel="stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css">
22 <link rel="stylesheet" href="sweetalert2/sweetalert2.css">
23 <script src="sweetalert2/sweetalert2.min.js"></script>
24 <script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
25 <script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
26 <link rel="stylesheet" href="style.css">
27
28
29
30
31 <body>
32 <?php include 'navbar_admin.php';?>
33 <br><br>
34 <div class="container">
35
36 <div class="row">
37 <div class="page header">
38 <h3 style="text-align: center;">Billing List</h3>
39
40 </div>
41
42 <table id="myTable" class="table table-bordered" >
43
44 <thead>
45 <th>ID</th>
46 <th >Total Cost</th>
47 <th >Action</th>
48 </thead>
49
50 <tbody>
51 <?php while($row=mysqli_fetch_assoc($result)){?>
52 <tr>
53 <td> <?php echo $row['id']?> </td>
54 <td> <?php echo $row['tcost']?> </td>
55 <td>
56 <a class="btn btn-info" href="showbill.php?id=<?php echo $row['id']; ?>">View</a>
57 <!--
58 <a class="btn btn-primary" href="editbill.php?id=<?php echo $row['id']; ?>">Edit</a>
59 -->
60 <a class="btn btn-danger" onclick="return confirm('Are u sure?')" href="deletebill.php?id=<?php echo $row['bill_id']; ?>">Delete</a>
61 </td>
62 </tr>
63 <?php }?>
64 </tbody>
65
66 </table>
67
68 </div>
69
70 </div>
71 </body>
72 <script>
73 $(document).ready(function(){
74 $('#myTable').dataTable();
75 });
76 </script>
77 </html>